﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/app/style/css/index.css" />
	<script type="text/javascript">
		/** // 删除菜品项
		function removeSorder(node) {
			var gid = node.lang;
			window.location.href = "/wirelessplatform/sorder.html?method=removeSorder&gid="+gid;
		}
		
		// 修改菜品项数量
		function alterSorder(node) {
			var snumber = node.value;
			var gid = node.lang;
			window.location.href = "/wirelessplatform/sorder.html?method=alterSorder&gid="+gid+"&snumber="+snumber;
		}
		*/
	    /* function removeSorder() {
	 
			window.location.href = "${pageContext.request.contextPath }/app/caixiangxi.jsp";
		}  */
		// 下单
		function genernateOrder() {
			  $.ajax({
				url : '${pageContext.request.contextPath }/OrdersServlet/addOrder',
				type : 'post',
				data :{"totalPrice": ${food.price},"zhuohao":<%=request.getParameter("zhuohao") %>},
				success : 	function(r){
				if(r){  
					window.location.href = "${pageContext.request.contextPath }/app/clientOrderList.jsp";
			 	}
			} 
			
		});  
	}
	</script>
</head>

<body style="text-align: center">
	<div id="all">
		<div id="menu">
			<!-- 餐车div -->
			<div id="count">
				<table align="center" width="100%">
					<tr height="40">
				 		<td align="center" width="20%">菜名</td>
				 		<td align="center" width="20%">单价</td>
				 		<td align="center" width="20%">数量</td>
				 		<td align="center" width="20%">小计</td>
				 		<td align="center" width="20%">操作</td>
				 	</tr>
					<tr height="60">
					 		<td align="center" width="20%">${food.foodName}</td>
					 		<td align="center" width="20%">&yen;&nbsp;${food.price}</td>
					 		<td align="center" width="20%">
					 			<input type="text" value="1" size="3" lang="3" onblur="alterSorder(this)"/>
					 		</td>
					 		<td align="center" width="20%">&yen;&nbsp;${food.price}</td>
					 		<td align="center" width="20%">
					 			<input type="button" value="返回" class="btn_next" lang="3" onclick="javascript:history.go(-1);" />
					 		</td>
				 	</tr>

					<tr>
						<td colspan="6" align="right">总计:
							<span style="font-size:36px;">&yen;&nbsp;${food.price}</span>
							<label
								id="counter" style="font-size:36px"></label>
						</td>
					</tr>
					<tr>
						<td colspan="6" style="margin-left: 100px; text-align: center;"align="right">
							<input type="hidden" name="bId" value="">
							
								
								
									<input type="button" value="下单" class="btn_next" onclick="genernateOrder()" />
								
							
						</td>
					</tr>
				</table>
			</div>
		</div>

		<!-- 右边列表，  -->
		<div id="dish_class"
			style="padding-top: 50px; width: 100px; padding-right: 50px;">
			<center>
				<h1 style="font-size: 100px;">欢迎光临</h1>
			</center>

		</div>
	</div>
</body>
</html>
